\begin{tikzpicture}

	\begin{timelinediagram}

		\renewcommand{\timestepvector}{0,-0.8}

		% initial timelines

		\path (0,0) node (timelineanchor) {};
		\newtimeline{server}
		\path (server) node[above, align=center] (serverlabel) {\normalsize Server\\};

		\path (timelineanchor)+(5.5,0) node (timelineanchor) {};
		\newtimeline{parent}
		\path (parent) node[above, align=center] (parentlabel) {\normalsize Parent\\};

		\path (timelineanchor)+(3.5,0) node (timelineanchor) {};
		\newtimeline{client}
		\path (client) node[above, align=center] (clientlabel) {\normalsize Client\\};

		\activate{client}
		\timestep

		% session request

		\transition{client}{parent}{}
		\node[align=center] at (transitionlabel) {call $cap_{parent}$ \\ session(id, name, args)};
		\timestep

		% parent notifies server about updated "session_requests"
		\draw[arrow, densely dotted] (parent) -- node[align=center] {"session requests" ROM \\ updated} (server);
		\transition{parent}{client}{return}

		\activate{server}
		\renewcommand{\timestepvector}{0,-0.4}
		\timestep
		\deactivate{client}
		\timestep
		\renewcommand{\timestepvector}{0,-0.8}

		% server picks up session requests

		\transition{server}{parent}{}
		\node[align=center] at (transitionlabel) {call $cap_{rom}$ \\ update};
		\renewcommand{\timestepvector}{0,-1}
		\timestep

		% parent generates "session_requests"

		\path (parent)+(-10ex,0) node [inner ysep=0, inner sep=0, umlinfo, anchor=east] (requestsrom) {\tiny
\begin{lstlisting}
<session_requests>
  <create name=...
          id=.../>
</session_requests>
\end{lstlisting}
};

		\draw[arrow, densely dashed] (parent) -- node {generate} (requestsrom);
		\timestep
		\renewcommand{\timestepvector}{0,-1}

		\transition{parent}{server}{return}

		\timestep

		% server creates session object

		\transition{server}{parent}{}
		\node[align=center] at (transitionlabel) {call $cap_{parent}$ \\ deliver id, $cap_{session}$};

		\renewcommand{\timestepvector}{0,-0.4}
		\timestep

		% parent notifies client
		\draw[arrow, densely dotted] (parent) -- node[align=center] {notify \\ session response} (client);
		\activate{client}

		\timestep
		\transition{parent}{server}{return}
		\timestep
		\deactivate{server}
		\timestep
		\renewcommand{\timestepvector}{0,-0.8}

		% cliend requests cap

		\transition{client}{parent}{}
		\node[align=center] at (transitionlabel) {call $cap_{parent}$ \\ session\_cap(id)};
		\timestep
		\transition{parent}{client}{}
		\node[align=center] at (transitionlabel) {return \\ $cap_{session}$};
		\timestep

	\end{timelinediagram}

	\begin{scope}[on background layer]
	\node[timelinegroup, fit=(serverlabel)  (server)] {};
	\node[timelinegroup, fit=(parentlabel)  (parent)] {};
	\node[timelinegroup, fit=(clientlabel)  (client)] {};
	\end{scope}

\end{tikzpicture}
